<?
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('error_reporting', E_ALL);
// Includes
include('../inc/db.inc.php');
include('../inc/lofi_functions.php');
include('../inc/functions.inc.php');
include('../inc/classTextile.php');
// Get all pages, categories, and settings
$pages = get_pages();
$cats = get_categories();
$settings = get_settings();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cheshire Wedding Photographer Jeff Ascough</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css" media="screen">@import "./iui/iui.css";</style>
<script type="application/x-javascript" src="./iui/iui.js"></script>
<!--
<script type="application/x-javascript" src="http://10.0.1.2:1840/ibug.js"></script>
-->
</head>

<body onclick="console.log('Hello', event.target);">
    <div class="toolbar">
        <h1 id="pageTitle"></h1>
        <a id="backButton" class="button" href="#"></a>
        <a class="button" href="#contactForm">Contact</a>
    </div>
    
    <ul id="home" title="Jeff Ascough" selected="true">
		<? foreach ($pages as $p) { ?><li><a href="page.php?p=<?=$p['page_id']?>"><?= ucfirst($p['page_title'])?></a></li><? } ?>
        <? foreach ($cats as $c) { ?><li><a href="#<?=$c['category_name']?>"><?=$c['category_name']?></a></li><? } ?>
		<li><img src="header.jpg" /></li>
    </ul>
	<? foreach ($cats as $c) { ?>
	<? $gals = get_galleries($c['category_id']); ?>
    <ul id="<?=$c['category_name']?>" title="<?=$c['category_name']?>">
        <? foreach ($gals as $g) { ?><li><a href="gallery.php?g=<?=$g['gallery_id']?>"><?=$g['gallery_name']?></a></li><? } ?>
    </ul>
    <? } ?>
    
    <div id="player" class="panel" title="Now Playing">
        <h2>If this weren't just a demo, you might be hearing a song...</h2>
    </div>
    <form id="contactForm" class="dialog" action="contact.php" method="post">
        <fieldset>
            <h1>Contact Jeff Ascough</h1>
            <a class="button leftButton" type="cancel">Cancel</a>
            <a class="button blueButton" type="submit">Send</a>
            
            <label>Name:</label>
            <input id="name" type="text" name="name"/>
            <label>Wedding date:</label>
            <input type="text" name="date"/>
			<label>Location:</label>
            <input type="text" name="location"/>
			<label>Email:</label>
            <input type="text" name="email"/>
			<label>Phone:</label>
            <input type="text" name="phone"/>
			<p>Email: <a href="mailto:enquiries@jeffascough.com">enquiries@jeffascough.com</a></p>
			<p>Freephone: <a href="tel:0800 634 3018">0800 634 3018</a></p>
			<p>Mobile: <a href="tel:0800 634 3018">07764 791910</a></p>
        </fieldset>
    </form>

    <div id="settings" title="Settings" class="panel">
        <h2>Playback</h2>
        <fieldset>
            <div class="row">
                <label>Repeat</label>
                <div class="toggle" onclick=""><span class="thumb"></span><span class="toggleOn">ON</span><span class="toggleOff">OFF</span></div>
            </div>
            <div class="row">
                <label>Shuffle</label>
                <div class="toggle" onclick="" toggled="true"><span class="thumb"></span><span class="toggleOn">ON</span><span class="toggleOff">OFF</span></div>
            </div>
        </fieldset>
        
        <h2>User</h2>
        <fieldset>
            <div class="row">
                <label>Name</label>
                <input type="text" name="userName" value="johnappleseed"/>
            </div>
            <div class="row">
                <label>Password</label>
                <input type="password" name="password" value="delicious"/>
            </div>
            <div class="row">
                <label>Confirm</label>
                <input type="password" name="password" value="delicious"/>
            </div>
        </fieldset>
    </div>
</body>
</html>